package Array;

/**
 * Enjoy programming!!!
 * Time: 2021/10/27 -  9:12
 */
public class ArrrayHomWork02 {
        public static void main(String[] args){
            int[] array = new int[10];
            int[] array1 = new int[10];
            int n = 0;//不同于j的计数器，用来计5之后的数
            for (int i = 0; i < 10; i++){
                array[i] = i + 1;
            }
            for (int j = 0; j < 10; j++){
                n = j;
                if (n > 4){
                    n -= 5;
                    array1[j] = array[n];
                    continue;
                }
                array1[j] = array[j + 5];

            }
            for (int element : array1){
                System.out.print(element + " ");
            }
        }
    }

